// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const book = JSON.parse(JSON.stringify(event))
  delete book._id
  delete book.access_token
  const { data } = await cloud.database().collection('books').where({
    bookId: book.bookId
  }).update({
    data: book
  })
  return data
}
